-
Notifications
You must be signed in to change notification settings - Fork 3
model: [WIP] explicit quantized layer #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the quantization layer creation system to use explicit quantized layer classes instead of dynamically modifying linear layers. The changes introduce separate QIntLinear and QFloatLinear classes with their own forward methods, replacing the previous approach of monkey-patching forward methods onto existing layers.
Key changes:
- Introduction of explicit quantized layer classes (
QLinear,QIntLinear,QFloatLinear) - Refactored layer creation methods to use these new classes instead of dynamic modification
- Updated parameter handling to support proper data type management for scales
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/optimum/rbln/transformers/utils/rbln_quantization.py | Refactored quantization logic to use explicit layer classes and improved scale parameter handling |
| src/optimum/rbln/transformers/utils/qlinear.py | Added new quantized linear layer classes with explicit forward implementations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Pull Request Description
Type of Change
Changes Overview
Motivation and Context
Checklist
Additional Information
Related Issues
Conventional commit
Type candidate
model: Adding New models or Bugfix for existing modelsperformance: Optimizing some models or this library itselfrefactor: Re-arrange class architecture, or more.doc: Update docstring onlydependency: Update requirements, something like that.other: None of above.